﻿using Furion.DynamicApiController;
using HOPU.OnlineSchool.Application.Users.Dtos;
using HOPU.OnlineSchool.Application.Users.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HOPU.OnlineSchool.Application.Users
{
    /// <summary>
    /// 用户接口
    /// </summary>
    public class UserAppService: IDynamicApiController
    {
        private readonly IUserService _userService;

        public UserAppService(IUserService userService)
        {
            _userService = userService;
        }
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<LoginInfoOutPut> Login(LoginInfoInput input)
        {
           return await _userService.Login(input);
        }

        public UserInfoDto GetInfo()
        {
            var dto = new UserInfoDto()
            {
                Avatar = "",
                Name = "孙悟空",
                Roles = new string[] { "Admin" }
            };
            return dto;
        }
    }
}
